﻿class CDirection {
    X: number;
    Y: number;

   

    constructor(x?: number, y?: number) {
        if (x && y) {
            this.X = x;
            this.Y = y;
        }
        else
            this.SetRandomly();
    }

    private SetRandomly() {
        this.X = (Math.random() * 20) - 10;      // -1 - 1
        this.Y = (Math.random() * 20) - 10;      // -1 - 1
    }


}